/**
 * 单个指标的描述对象，用以分析报告中的数据
 * Created by hdr on 17/8/11.
 */

export default class MeasureItem {
  value;
  name;
  icon;
  max;
  desc;
  level;
  levelNames;
  isStand;
  unit;
  bar;
  boundaries;
  min;
  offset;
  showBar;
  fixLevel;
  isBodyShape;
  isExtend;
  levelColor;
  levelName;
  constructor () {
    this.level = 0;
    this.levelNames = [];
    this.isStand = true;
    this.unit = '';
    this.bar = [];
    this.boundaries = [];
    this.min = 0;
    this.offset = 0;

    this.showBar = true;

    this.fixLevel = 1;
    this.isBodyShape = false;

    this.isExtend = false
  }

  get levelName () {
    if (this.levelNames.length > 0) {
      return this.levelNames[this.level]
    }
    return null
  }

  get levelColor () {
    if (this.bar.length > 0) {
      return this.bar[this.level]
    }
    return 0
  }

  toggleExtend () {
    this.isExtend = !this.isExtend
  }
}



// WEBPACK FOOTER //
// ./src/report/MeasureItem.js
